#!/usr/bin/perl
# configuration:
$logfile = "/usr/local/frogd/data/frogd.log";

# programme
open(FILE, $logfile);
@lignes = <FILE>;
$last=$lignes[$#lignes];
chop($last);
@element = split(/:/, $last);

if ($ARGV[0] eq "-raw") {
  print "$last\n";
} else { 
  print "temperature: $element[2]\n";
  print "pression: $element[3]\n";
  print "humidite: $element[4]\n";
  print "\n";
  print "frogd       : http://www.redge.net/fr/frog/\n";
  print "les capteurs: http://www.froggyhome.com\n";
}



close(FILE);


